package consts

import "github.com/gogf/gf/v2/errors/gcode"

// -------------通用配置-----------------
var TokenClaims = &struct {
	UserId        string
	TenantCode    string
	Username      string
	CompanyCode   string
	PlatformAdmin string
	TenantAdmin   string
}{
	UserId:        "user_id",
	TenantCode:    "tenant_code",  // 决定用户信息
	Username:      "username",     // 决定用户登陆信息
	CompanyCode:   "company_code", // 决定用户查询数据范畴
	PlatformAdmin: "platform_admin",
	TenantAdmin:   "tenant_admin",
}

// --------------专用配置------------

type DdicChannel struct {
	Name  string `json:"name"`
	Label string `json:"label"`
}

var PayChannels = [2]DdicChannel{
	{
		Name:  "wxpay",
		Label: "微信",
	},
	{
		Name:  "alipay",
		Label: "支付宝",
	},
}

var (
	MerchantNotFound       = gcode.New(400010, "未找到相关联商户", "")
	LoadPrivateKeyFailed   = gcode.New(400011, "加载商户私钥失败", "")
	LoadCertificateFailed  = gcode.New(400012, "加载商户证书失败", "")
	WechatClientInitFailed = gcode.New(400013, "微信支付发起失败", "")
	WechatPayFailed        = gcode.New(400014, "微信支付失败", "")
	WechatRefundFailed     = gcode.New(400015, "微信退款失败", "")
	NotifyAppIdNotExist    = gcode.New(400016, "FAIL", "小程序appid不存在")
	NotifyFailed           = gcode.New(400017, "FAIL", "验签或解密失败")
	MsgSendFailed          = gcode.New(400018, "FAIL", "消息发送失败")
	PayChannelNameNotExist = gcode.New(400019, "支付渠道不存在", "")
	AddFailed              = gcode.New(400020, "新增失败", "")
	DeleteFailed           = gcode.New(400021, "删除失败", "")
	UpdateFailed           = gcode.New(400022, "更新失败", "")
	ListFailed             = gcode.New(400023, "查询失败", "")
)

const NamedSeperator = "::"
const ElemSeperator = ","
const SegmentSeperator = "-"
